
package com.hc.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hc.dao.IUserAndRoleDao;
import com.hc.domain.Role;
import com.hc.domain.UserAndRole;
import com.hc.service.IUserAndRoleService;
@Service("userAndRoleService")
public class UserAndRoleServiceImpl implements IUserAndRoleService {
	@Resource
	private IUserAndRoleDao userAndRoleDao;

	@Override
	public int getRoleUserCount(int roleId) {
		return userAndRoleDao.getRoleUserCount(roleId);
		
	}

	@Override
	public void deleteUserAuthByRole(Role role) throws Exception {
		userAndRoleDao.deleteUserAuthByRole(role);
	}

	@Override
	public UserAndRole getUserRoleByUserId(Integer id) {
		return userAndRoleDao.getUserRoleByUserId(id);
		
	}

	@Override
	public void updateOrSave(UserAndRole uar) {
		userAndRoleDao.updateOrSave(uar);
	}

}

